1. Field of the Invention
The present invention relates to a video decoder, and more particularly, to a circuit for synchronizing a picture for controlling decoding synchronization in units of a picture so as not to underflow or overflow a bit buffer for a variable length decoder (VLD), and a method therefor.
2. Description of the Related Art
In the MPEG-2 (moving picture experts group) system, a picture may be an I (intra-coded) picture, a B (bidirectionally predictive-coded) picture, or a P (predictive-coded) picture. The MPEG-2 video is coded in units of a frame or units of a field. The I picture can be decoded regardless of other pictures. The P picture can be decoded from preceding I or P pictures. The B picture can be decoded from preceding I or P pictures and successive I or P pictures. When the input includes all three types of I, B, and P pictures, it is possible to restore an original picture only by appropriately controlling decoding timing and output timing so the decoding order is different from the output (display) order.
FIG. 1 is a block diagram of a video decoder for describing a conventional picture decoding synchronizing method. In FIG. 1, a packetized elementary stream (PES) decoder 10 parses an input PES stream, outputs a video elementary stream to a bit buffer 20, and outputs a presentation time stamp (PTS) and a decoding time stamp (DTS) to a variable length decoder (VLD) 30. The VLD 30 receives the video elementary stream output from the bit buffer 20 in units of a picture and determines the point of time at which the picture is to be decoded according to the parsed PTS and DTS. When both the PTS and the DTS exist, the DTS is determined to indicate the point in time at which the picture is decoded. When only the PTS exists, the PTS is determined to indicate the point in time at which the picture is decoded.
When the decoding point of time of the picture unit is determined by the VLD 30 using only the PTS and the DTS output from the PES decoder 10, problems occur if the PES stream is damaged by undesirable states such as an error in a transmission channel with respect to the transferred bit stream. If the damaged portion is the PTS or the DTS, the decoding order and the output order do not coincide with the original decoding order and the output order when the picture decoding is synchronized in units of a picture in the VLD 30 according to the damaged PTS and DTS.
In particular, a predetermined number of pictures to be discarded without being decoded is very large or the pictures are held for an extended period of time in the VLD 30 according to the deviation between the original PTS and DTS and the erroneous PTS and DTS. Accordingly, an unattractive result is obtained when the decoded output is displayed on a screen.
It is an object of the present invention to provide a picture decoding synchronizing circuit, in which a bit buffer does not overflow or underflow because a picture is decoded using a presentation time stamp (PTS) and a decoding time stamp (DTS) if the PTS and DTS are undamaged. If the DTS and PTS are damaged, they are not used in a video decoder.
It is another object of the present invention to provide a picture decoding method in which the PTS and the DTS are used if they are undamaged, and are otherwise not used.
To achieve the first object, there is provided a picture decoding synchronizing circuit, comprising a detector for detecting whether at least one of a presentation time stamp (PTS) and a decoding time stamp (DTS) which are transferred through an input bit stream are distorted by errors, and outputting a detect signal, a determiner for determining an actual DTS value using a transferred PTS and DTS if no errors are detected from the transferred PTS and DTS according to the detect signal, and determining an approximated DTS value using the value obtained by adding the DTS value of a previous picture to a predetermined offset value, if errors an error is detected in at least one of the PTS and DTS, and a decoder for decoding the input bit stream in units of a picture, in synchronization with one of the actual DTS value and the approximated DTS value.
To achieve the second object, there is provided a picture decoding synchronizing method, comprising the steps of (a) determining whether at least one of a presentation time stamp (PTS) and a decoding time stamp (DTS), transferred through an input bit stream, is distorted, (b) determining an actual DTS value using a transferred PTS and the DTS if no error is detected in the transferred PTS and DTS, according to a detect signal, and otherwise, determining an approximated DTS value by adding a DTS value of a previous picture to an offset value, and (c) decoding the input bit stream in units of a picture, in synchronization with one of the actual DTS value and the approximated DTS value.